package com.yc.bos.service.impl;

import com.yc.bos.dao.IDecidedzoneDao;
import com.yc.bos.dao.ISubareaDao;
import com.yc.bos.model.Decidedzone;
import com.yc.bos.model.PageBean;
import com.yc.bos.model.Subarea;
import com.yc.bos.service.IDecidedzoneService;
import com.yc.bos.service.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;

@Service
@Transactional
public class DecidedzoneServiceImpl  extends BaseServiceImpl<Decidedzone> implements IDecidedzoneService{

    @Override
    public void save(Decidedzone dz, String[] subareaIds) {
        decidedzoneDao.save(dz);

        for (String subareaId:subareaIds){
            Subarea subarea=subareaDao.findById(subareaId);
            subarea.setDecidedzone(dz);
        }

    }

    @Override
    public void pageQuery(PageBean<Decidedzone> pd) {
        decidedzoneDao.pageQuery(pd);

    }

    @Override
    public void save(Decidedzone entity) {

    }

    @Override
    public void update(Decidedzone entity) {

    }

    @Override
    public void delete(Decidedzone entity) {

    }

    @Override
    public Decidedzone findById(Serializable id) {
        return null;
    }

    @Override
    public List<Decidedzone> findAll() {
        return null;
    }
}
